<script type="text/javascript">
    function onCheckClick(ckContent)
    {
        if(ckContent.checked)
            ckContent.value="true";
        else
            ckContent.value="false"
        if(ckContent.name=="ckFocusContent")
        {
            //var url = "<?php echo url_for("other/focus"); ?>" + "?random=" +  Math.random() + "&catalogId=1000&contentTypeId=1000";
            //var focusId = window.showModalDialog(url,null,"dialogWidth:800px;dialogHeight:400px;help:0;status:0;scroll:1;center:1;resizeable:off;");
            //if(focusId != null)
              //$("#txtHideFocusId").val(focusId);
            if(ckContent.checked)
                $("#trFocus").css("display","block");
            else
                $("#trFocus").css("display","none");
        }
    }

        function defaults(){
        if(1==<?php echo $focTrue; ?>){
            $("#trFocus").css("display","block");
            $("#ckFocusContent").attr("checked",true);
            $("#ckFocusContent").attr("value",true);
        }
        else{
            $("#trFocus").css("display","none");
            $("#ckFocusContent").attr("checked",false);
            $("#ckFocusContent").attr("value",false);
        }
        if(1==<?php echo $recTrue; ?>){
            $("#ckRecommendContent").attr("checked",true);
            $("#ckRecommendContent").attr("value",true);
        }
        else{
            $("#ckRecommendContent").attr("checked",false);
            $("#ckRecommendContent").attr("value",false);
        }
        if(1==<?php echo $topTrue; ?>){
            $("#ckTop").attr("checked",true);
            $("#ckTop").attr("value",true);
        }
        else{
            $("#ckTop").attr("checked",false);
            $("#ckTop").attr("value",false);
        }
        /*if(1==<?php echo (1==$photoGroup->getIsAuditB()?"1":"0")  ?>)
        {
            $("#auditing1").attr("checked",true);
        }else
        {
            $("#auditing0").attr("checked",true);
        }*/
        var i=1;
        <?php

            if(count($photos)>5&&count($photos)<=10){
               echo "$('#hidAdd').attr('value',5);";
            }else if(count($photos)>10&&count($photos)<=15){
               echo "$('#hidAdd').attr('value',10);$('#addImgs').attr('disabled',true);
                $('#addImgs').attr('value','图片个数已达上限');";
            }else
            {
               echo "$('#hidAdd').attr('value',0);";
            }
            echo "addImg();";
        foreach($photos as $photo){
        ?>
            $("#Txt"+i).attr("value","<?php echo $photo->getLink() ?>");
            $("#Img"+i).attr("src","<?php echo $photo->getLink() ?>");
            $("#Des"+i).attr("value","<?php echo $photo->getBrief() ?>");
            i++;
        <?php
        }
        ?>
        if($("#Txt0").attr('value')==$("#Txt1").attr('value')){
           $("#firstPhoto").attr("checked",true);
        }
    }
    function clearFileUrl(id){
        $('#'+id).attr("value",'');
    }
</script>
<body onload="defaults();">
<form  action="<?php echo url_for('album/edit?content=' .$photoGroup->getPhoto_group_id()); ?>" method="post" enctype="multipart/form-data">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="newsTd">美图编辑：</td>
    <td align="right" style="padding-right:300px"><input name="btnEdit" type="submit" id="btnEdit1" value="保 存" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="btnBack" type="button" value="取 消" onclick="history.go(-1);" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="btnPublish" type="submit" id="btnPublish1" value="发 布" style="display:none;" /></td>
  </tr>
  <tr>
    <td class="newsTd">栏目：</td>
    <td><label>
      <?php
@include_component("other","catalog",array('selectedId'=>$photoGroup->getCatalogId()));
?>
    </label></td>
  </tr>
  <tr>
    <td class="newsTd">文档属性：</td>
    <td>推荐
<input type="checkbox" id="ckRecommendContent" name="ckRecommendContent" value="false" onclick="onCheckClick(this)" />&nbsp;&nbsp;&nbsp;
      焦点
      <input type="checkbox" id="ckFocusContent" name="ckFocusContent" value="false" onclick="onCheckClick(this)" />&nbsp;&nbsp;&nbsp;
      置顶
      <input type="checkbox" id="ckTop" name="ckTop" value="false" onclick="onCheckClick(this)" />
&nbsp;&nbsp;</td>
  </tr>
  <tr>
<td colspan="6">
    <div style="display:none;" id="trFocus">
    <?php echo include_component("other","focus",array('focusId'=>$focusId)); ?>    </div>        </td>
</tr>
  <tr>
    <td class="newsTd">相册名称：</td>
    <td><label>
      <input type="text" name="title" value="<?php echo $photoGroup->getTitle(); ?>"  />
      </label>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="newsTd">来源：</span>
<input type="text" name="sources" value="<?php echo $photoGroup->getSource(); ?>" /></td>
  </tr>
  <tr>
    <td colspan="2"><table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="62px" height="25px">TAG标签：</td>
        <td><input name="tag" type="text" size="30" value="<?php echo $photoGroup->getTag(); ?>" /></td>
        <td width="70%" rowspan="2">多个关键字和TAG标签，请以“，”分隔</td>
      </tr>
      <tr>
        <td width="62px" height="25px" align="right">关键字：</td>
        <td><input type="text" name="keyword" size="30" value="<?php echo $photoGroup->getKeyword(); ?>" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="newsTd">缩略图：</td>
    <td><label>
    <input type="text" id="Txt0" name="Txt0" value="<?php echo $photoGroup->getSnapshot(); ?>" />
        <input name="button" type="button"  onclick="getFileUrlFromCKFinder('Txt0','Img0')" value="浏览" />
        <input name="button" type="button"  onclick="clearFileUrl('Txt0')" value="删除" />
</label></td>
  </tr>
  <tr>
      <td colspan="2"><table width="90%" height="53" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img id="Img0" src="<?php echo $photoGroup->getSnapshot(); ?>" name="Img0" alt='256*256' width="256" height="256" /></td>
        </tr>
          </table></td>
  </tr>
            <tr>
    <td colspan="2"><br />
      <input type="checkbox" id="firstPhoto" name="firstPhoto" value="1" />
图集第一幅图
<label></label></td>
  </tr>
  <tr>
    <td colspan="2"><br />
      图集内容：
    <label></label></td></tr>
    <tr id="tr1">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 1 </td>
  <td rowspan="3" align="left"><img id="Img1" name="Img1" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt1" name="Txt1" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt1','Img1')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt1')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des1" name="Des1" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
               <tr id="tr2">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 2 </td>
  <td rowspan="3" align="left"><img id="Img2" name="Img2" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt2" name="Txt2" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt2','Img2')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt2')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des2" name="Des2" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
               <tr id="tr3">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 3 </td>
  <td rowspan="3" align="left"><img id="Img3" name="Img3" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt3" name="Txt3" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt3','Img3')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt3')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des3" name="Des3" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
               <tr id="tr4">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 4 </td>
  <td rowspan="3" align="left"><img id="Img4" name="Img4" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt4" name="Txt4" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt4','Img4')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt4')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des4" name="Des4" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
               <tr id="tr5">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 5 </td>
  <td rowspan="3" align="left"><img id="Img5" name="Img5" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt5" name="Txt5" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt5','Img5')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt5')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des5" name="Des5" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr6" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 6 </td>
  <td rowspan="3" align="left"><img id="Img6" name="Img6" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt6" name="Txt6" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt6','Img6')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt6')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des6" name="Des6" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr7" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 7 </td>
  <td rowspan="3" align="left"><img id="Img7" name="Img7" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt7" name="Txt7" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt7','Img7')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt7')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des7" name="Des7" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr8" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 8 </td>
  <td rowspan="3" align="left"><img id="Img8" name="Img8" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt8" name="Txt8" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt8','Img8')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt8')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des8" name="Des8" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr9" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 9 </td>
  <td rowspan="3" align="left"><img id="Img9" name="Img9" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt9" name="Txt9" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt9','Img9')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt9')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des9" name="Des9" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr10" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 10 </td>
  <td rowspan="3" align="left"><img id="Img10" name="Img10" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt10" name="Txt10" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt10','Img10')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt10')" value="删除" />
            </label></td>
  </tr>
        <tr>

          <td><p>图片简介：<br />
            <textarea id="Des10" name="Des10" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr11" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 11 </td>
  <td rowspan="3" align="left"><img id="Img11" name="Img11" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt11" name="Txt11" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt11','Img11')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt11')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des11" name="Des11" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr12" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 12 </td>
  <td rowspan="3" align="left"><img id="Img12" name="Img12" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt12" name="Txt12" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt12','Img12')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt12')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des12" name="Des12" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr13" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 13 </td>
  <td rowspan="3" align="left"><img id="Img13" name="Img13" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt13" name="Txt13" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt13','Img13')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt13')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des13" name="Des13" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr14" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 14 </td>
  <td rowspan="3" align="left"><img id="Img14" name="Img14" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt14" name="Txt14" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt14','Img14')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt14')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des14" name="Des14" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>
             <tr id="tr15" style="display:none;">
      <td colspan="3"><br />
      <table width="100%" cellSpacing="0" border="0">
        <tr>
          <td width="30%">图片 15 </td>
  <td rowspan="3" align="left"><img id="Img15" name="Img15" width="241" height="120" alt="241X120" /></td>
</tr>
        <tr>
          <td>本地上传：
            <label>
              <input type="text" id="Txt15" name="Txt15" value="" />
              <input name="button2" type="button"  onclick="getFileUrlFromCKFinder('Txt15','Img15')" value="浏览" />
              <input name="button" type="button"  onclick="clearFileUrl('Txt15')" value="删除" />
            </label></td>
  </tr>
        <tr>
          <td><p>图片简介：<br />
            <textarea id="Des15" name="Des15" cols="40" rows="4"></textarea>
            </p></td>
  </tr>
      </table></td></tr>

  <tr>
              <td colspan="2"><br>
<input id="addImgs" type="button" value="增加图片" onclick="addImg();" /><input id="hidAdd" type="hidden" value="5" /></td>
  </tr>
    <tr>
    <td colspan="2"><br />
      状&nbsp;&nbsp;&nbsp;态：
        <label>
    <?php echo $photoGroup->getStatus()->getName() ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        发布时间：
        <input type="text" name="nowtime" id="nowtime" value="<?php echo date('Y-m-d  H:i:s',strtotime($photoGroup->getPublishTime())); ?>" />
        &nbsp;&nbsp;
        <input name="button2" type="button" onclick="$('#nowtime').val(getCurrentDateTimeStr());" value="设为当前时间"/>
        </label></td>
    </tr>
  <tr>
              <td colspan="2"><br />点击率：<?php echo $photoGroup->getHitI(); ?>
&nbsp;&nbsp;&nbsp;点击调整：
<input name="hitMark" type="text" size="10" value="<?php echo $photoGroup->getHitMaskI(); ?>" />
<label></label></td>
  </tr>
<tr>
			<td align="center" colspan="2" style="height:50px;"><input type="hidden" name="albumEdit" id="albumEdit" value="2" />
                <input name="btnEdit" type="submit" id="btnEdit" value="保 存" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="btnBack" type="button" value="取 消" onclick="history.go(-1);" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="btnPublish" type="submit" id="btnPublish" value="发 布" style="display:none;" /></td>
		  </tr>
</table>
</form>
<script type="text/javascript">
    function addImg()
    {
        if($("#hidAdd").attr("value")<15){
            var imgnum=parseInt($("#hidAdd").attr("value"));
            for(var i=(imgnum+1);i<=(imgnum+5);i++){
               $("#tr"+i).attr("style","block");
            }
            $("#hidAdd").attr("value",(imgnum+5));
            if($("#hidAdd").attr("value")>=15)
            {
                $("#addImgs").attr("disabled",true);
                $("#addImgs").attr("value","图片个数已达上限");
            }
        }else{
        $("#addImgs").attr("disabled",true);
        $("#addImgs").attr("value","图片个数已达上限");
        }
    }
</script>
